<div id="cadre">
    <h2>Achat de cr&eacute;dits</h2>			
    <div id="texte">
	<?php if(!empty($packs)): ?>
		<h3>PACKS DE CR&Eacute;DIT DISPONIBLES*</h3>
		<table class="packs">
		<?php foreach($packs as $pack):  ?>
			<tr>
				<td style="text-align:center;">
					<form method="post" action="https://www.paypal.com/cgi-bien/webscr" name="p<?php  echo $pack->getId(); ?>" id="p<?php  echo $pack->getId(); ?>">
                        <input type="hidden" name="cmd" value="_xclick" />
                        <input type="hidden" name="charset" value="utf-8" />
                        <input type="hidden" name="business" value="<?php  echo $site->getEmailPaypal(); ?>" />
                        <input type="hidden" name="item_name" value="<?php  echo __SITE__ ; ?> - Achat du pack de <?php  echo $pack->getCredits(); ?> credit<?php  echo $pack->getCreditsPluriel(); ?>#<?php echo($user->isAuthenticated()?intval($user->getId()):0) ?>-<?php  echo $pack->getCredits(); ?>" />
                        <input type="hidden" name="quantity" value="1" />
                        <input type="hidden" name="amount" value="<?php  echo $pack->getPrix(); ?>" />
                        <input type="hidden" name="currency_code" value="<?php  echo $site->getIsoDevise(); ?>" />
                        <input type="hidden" name="no_shipping" value="0" />
                        <input type="hidden" name="return" value="<?php  echo _BASE_URI_ ?>paiement-accepte.html" />
                        <input type="hidden" name="cancel_return" value="<?php  echo _BASE_URI_ ?>paiement-annule.html" />
                        <input type="hidden" name="notify_url" value="<?php  echo _BASE_URI_ ?>valider-paiement.html" />
                        <input type="hidden" name="lc" value="FR" />
					</form>
					
					<a class="btn_achatcredit" href="#" id="p<?php echo $pack->getId().'-'.($user->isAuthenticated()?intval($user->getId()):0) ?>"><img src="images/<?php  echo $pack->getCredits(); ?>credits.jpg" alt="Pack de <?php  echo $pack->getCredits(); ?> crédits" /></a>
				</td>
				<td style="text-align:center;"><?php  echo $pack->getPrix(); ?> <?php  echo $site->getDevise(); ?></td>
				<?php  $valcredite = $pack->getPrix() / $pack->getCredits();?>
				<td>SOIT <?php  echo number_format( $valcredite , 2) ?> <?php  echo $site->getDevise(); ?> LE CR&Eacute;DIT</td>
			</tr>										
		<?php endforeach;?>
			
		</table>
		
		<div class="ast">* CLIQUEZ SUR L'IMAGE DU PACK CORRESPONDANT POUR LE SELECTIONNER</div>
		
		<div id="security">
			<img src="images/verifiedp.jpg" alt="PayPal verified" />
		</div>
		
		<div class="clear"></div>
	<?php else: ?>
		Aucun pack n'est disponible pour le moment
	<?php endif;?>
    </div>
</div>

